import { MiniGameActionObject } from "../../MiniGameActionObject";
import { FishBaseController } from "../ObjController/FishBaseController";
import { SWFPlayer } from "../../../../scene/modle/SWFPlayer";
import { FishDirection } from "../defin/FishDirection";
type int = number;
//class FishActionObject
    
    export  class FishActionObject extends MiniGameActionObject
    {
        constructor(arg1: FishBaseController, arg2: SWFPlayer=null)
        {
            super(arg1);
            this._swfPlayer = arg2;
            if (this._swfPlayer) 
            {
                this.addChild(arg2);
            }
            else 
            {
                graphics.beginFill(16711935);
                graphics.drawRect(0, 0, 50, 30);
                graphics.endFill();
            }
            return;
        }

        public set xSpeed(arg1: number)
        {
            this._xSpeed = arg1;
            return;
        }

        public set horizontalDirection(arg1: int)
        {
            this._horizontalDirection = arg1;
            return;
        }

        public get horizontalDirection(): int
        {
            return this._horizontalDirection;
        }

        public /* override */ Do(): void
        {
            (controller as FishBaseController).autoRun();
            if (this._horizontalDirection != FishDirection.RIGHT) 
            {
                this.x = this.x - this._xSpeed;
            }
            else 
            {
                this.x = this.x + this._xSpeed;
            }
            return;
        }

        public /* override */ dispose(arg1: Boolean=true): void
        {
            super.dispose();
            this._xSpeed = 0;
            if (this._swfPlayer) 
            {
                this._swfPlayer.dispose();
                this._swfPlayer = null;
            }
            return;
        }

        public get minDepth(): number
        {
            return this._minDepth;
        }

        public set minDepth(arg1: number)
        {
            this._minDepth = arg1;
            return;
        }

        public get maxDepth(): number
        {
            return this._maxDepth;
        }

        public set maxDepth(arg1: number)
        {
            this._maxDepth = arg1;
            return;
        }

        public get swfPlayer(): SWFPlayer
        {
            return this._swfPlayer;
        }

        public set swfPlayer(arg1: SWFPlayer)
        {
            this._swfPlayer = arg1;
            return;
        }

        protected /* var */_minDepth: number=0;

        protected /* var */_maxDepth: number=400;

        protected /* var */_xSpeed: number=0;

        protected /* var */_swfPlayer: SWFPlayer;

        protected /* var */_horizontalDirection: int=1;
    }
